
angular.module('mamApp').factory('NoticeManager', ['$http','api','paramsManager', function ($http,api,paramsManager) {
    var NoticeManager = {

        /**
         * 公告添加
         * @param params
         * @returns
         */

        noticeAdd: function (params) {
            return $http.post(api+'/admin/notices/notice', params).then(function (result) {
                return result;
            });
        },
        /**
         * 公告修改
         * @param params
         * @returns
         */

        noticeEdit: function (noticeId,params) {
            return $http.put(api+'/admin/notices/'+noticeId, params).then(function (result) {
                return result;
            });
        },
        /**
         * 公告删除
         * @param params
         * @returns
         */

        noticeDelete: function (ids) {
            return $http.delete(api+'/admin/notices/'+ids.join(",")).then(function (result) {
                return result;
            });
        },


        /**
         * 公告列表
         * @param params[pageNo,pageSize]
         * @returns result
         */
        noticeList: function (params,query) {
            return $http.get(api+'/admin/notices/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 专辑详情
         * @returns result
         */
        noticeDetail:function (noticeId) {
            return $http.get(api+'/admin/notices/'+noticeId).then(function (result) {
                return result;
            });
        }





    };

    return NoticeManager;
}]);
